import './index.scss'
import {InputComponent} from '../../../componet'
import  Select from '../select';
import { useState } from 'react'
import { Flex, Table } from 'antd';
import type { TableColumnsType} from 'antd';
import '../index.scss'
export default function Peopleliveserve() {
  //查询表单 
  let [formData,setformData]=useState({
    driction:'',
    type:'',
   status:0,
    speople:'',
    phone:'',
    address:'',
    inet:'',
    process:'',
 
    cpeople:''
  })
  //处理状态
  let clist=['已处理','未处理']
  //事件类型
 //网络

//定义表格列类型
  interface DataType {
    key: React.Key;

  }
  //定义表格列
  const columns: TableColumnsType<DataType> = [
    { title: '联系人', dataIndex: 'title' , width: 100},
    { title: '植物', dataIndex: 'type' , width: 100},
    { title: '联系电话', dataIndex: 'time' , width: 100},
    {'title':'操作',   fixed: 'right', width: 90,render: () => <a>详情</a>,}
  ];
  const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
  //定义表格数据
  const dataSource = Array.from<DataType>({ length: 20 }).map<DataType>((_, i) => ({
    key: i,
    age: 32,
    title:'标题',
    type:'事件类型',
    time:'上报时间',
    people:'上报人',
    phone:'2',
   
  }));

//修改事件描述
  const changeDriction = (e: string) => {
    let obj={...formData}
    obj.driction=e
    setformData(obj)
  }
  //修改上报人
  const changePeople = (e: string) => {
    let obj={...formData}
    obj.speople=e
    setformData(obj)
  }
  //修改事件类型
  const changeType = (e: string) => {
    let obj={...formData}
    obj.type=e
    setformData(obj)
  }
  //修改处理状态
  const changeStatus = (e: any) => {
    let obj={...formData}
    obj.status=e
    setformData(obj)
  }
  //修改处理流程
  const changeprocess = (e: string) => {
    let obj={...formData}
    obj.process=e
    setformData(obj)
  }
  //修改网络
  const changeinet = (e: string) => {
    let obj={...formData}
    obj.inet=e
    setformData(obj)
  }

  const hasSelected = selectedRowKeys.length > 0;
  return (
    <div className='pabpeo1'>
      <div className='header'>
<div className='pzbhbox'>
<span className='pableft'>标题</span> <InputComponent value={formData.driction} className='pzbright' onChange={changeDriction}></InputComponent>
</div>
  <button className='pzbbtn btn_red col_w'>查询</button>
  <button className='pzbbtn'>重置</button>
 
</div>

<Flex gap="middle" vertical>
      <Flex align="center" gap="middle">
      
        {hasSelected ? `Selected ${selectedRowKeys.length} items` : null}
      </Flex>
      <Table columns={columns} dataSource={dataSource}></Table>
    </Flex>
    </div>
  )
}
